﻿using System;
using System.Collections;
using Huirui.Cavan.Domain.MainBoundedContext.SystemModule;
using System.Collections.Generic;
using Huirui.Cavan.Domain.Seedwork;
using Huirui.Cavan.Domain.MainBoundedContext.StockModule;

namespace Huirui.Cavan.Domain.MainBoundedContext.PurchaseModule
{
    #region PurchaseReturn

    /// <summary>
    /// PurchaseReturn object for NHibernate mapped table 'PurchaseReturn'.
    /// </summary>
    [Serializable]
    public class PurchaseReturn : Persistent<string>
    {
        #region Member Variables

        protected DateTime _returnDate;
        protected string _supplierInvoiceNumber;
        protected string _currency;
        protected decimal _currencyRate;
        protected decimal _taxRate;
        protected string _receivingNumber;
        protected string _invoiceDescription;
        protected string _remark;
        protected string _deliveryAddress;
        protected string _contact;
        protected string _contactTelephone;
        protected SystemIdentifier.CheckedStatus _checkedStatus;
        protected Corporation _corporation;
        protected Employee _purchaseEmployee;
        protected Project _project;
        protected Supplier _supplier;
        protected StockInOut _stockInOut;
        protected WareHouse _wareHouse;
        protected Purchase _purchase;
        protected UserAccount _producer;

        #endregion

        #region Constructors

        public PurchaseReturn() { }

        public PurchaseReturn(string id, DateTime returnDate, string supplierInvoiceNumber, string currency, decimal currencyRate, decimal taxRate, string receivingNumber, 
            string invoiceDescription, string remark, string deliveryAddress, DateTime createDate, DateTime modifyDate, UserAccount editUser, Corporation corporation,
            Employee purchaseEmployee, Project project, Supplier supplier, StockInOut stockIn, SystemIdentifier.CheckedStatus checkedStatus,
            WareHouse wareHouse, string contact, string contactTelephone, Purchase purchase)
        {
            this.Id = id;
            this._returnDate = returnDate;
            this._supplierInvoiceNumber = supplierInvoiceNumber;
            this._currency = currency;
            this._currencyRate = currencyRate;
            this._receivingNumber = receivingNumber;
            this._invoiceDescription = invoiceDescription;
            this._remark = remark;
            this._deliveryAddress = deliveryAddress;
            this._createDate = createDate;
            this._modifyDate = modifyDate;
            this._producer = editUser;
            this._corporation = corporation;
            this._purchaseEmployee = purchaseEmployee;
            this._project = project;
            this._supplier = supplier;
            this._stockInOut = stockIn;
            this._checkedStatus = checkedStatus;
            this._wareHouse = wareHouse;
            this._contact = contact;
            this._contactTelephone = contactTelephone;
            this._taxRate = taxRate;
            this._purchase = purchase;
        }

        #endregion

        #region Public Properties


        public virtual DateTime ReturnDate
        {
            get { return _returnDate; }
            set { _returnDate = value; }
        }

        public virtual string SupplierInvoiceNumber
        {
            get { return _supplierInvoiceNumber; }
            set
            {
                if (value != null && value.Length > 100)
                    throw new ArgumentOutOfRangeException("Invalid value for SupplierInvoiceNumber", value, value.ToString());
                _supplierInvoiceNumber = value;
            }
        }

        public virtual string Currency
        {
            get { return _currency; }
            set
            {
                if (value != null && value.Length > 20)
                    throw new ArgumentOutOfRangeException("Invalid value for Currency", value, value.ToString());
                _currency = value;
            }
        }

        public virtual decimal CurrencyRate
        {
            get { return _currencyRate; }
            set { _currencyRate = value; }
        }

        public virtual decimal TaxRate
        {
            get { return _taxRate; }
            set { _taxRate = value; }
        }

        public virtual string ReceivingNumber
        {
            get { return _receivingNumber; }
            set
            {
                if (value != null && value.Length > 100)
                    throw new ArgumentOutOfRangeException("Invalid value for ReceivingNumber", value, value.ToString());
                _receivingNumber = value;
            }
        }

        public virtual string InvoiceDescription
        {
            get { return _invoiceDescription; }
            set
            {
                _invoiceDescription = value;
            }
        }

        public virtual string Remark
        {
            get { return _remark; }
            set
            {
                _remark = value;
            }
        }

        public virtual string DeliveryAddress
        {
            get { return _deliveryAddress; }
            set
            {
                if (value != null && value.Length > 200)
                    throw new ArgumentOutOfRangeException("Invalid value for DeliveryAddress", value, value.ToString());
                _deliveryAddress = value;
            }
        }

        public virtual string Contact
        {
            get { return _contact; }
            set
            {
                _contact = value;
            }
        }

        public virtual string ContactTelephone
        {
            get { return _contactTelephone; }
            set
            {
                _contactTelephone = value;
            }
        }

        public virtual SystemIdentifier.CheckedStatus CheckedStatus
        {
            get { return _checkedStatus; }
            set
            {
                _checkedStatus = value;
            }
        }

        public virtual Corporation Corporation
        {
            get { return _corporation; }
            set { _corporation = value; }
        }

        public virtual Employee PurchaseEmployee
        {
            get { return _purchaseEmployee; }
            set { _purchaseEmployee = value; }
        }

        public virtual Project Project
        {
            get { return _project; }
            set { _project = value; }
        }

        public virtual Supplier Supplier
        {
            get { return _supplier; }
            set { _supplier = value; }
        }

        public virtual Purchase Purchase
        {
            get { return _purchase; }
            set { _purchase = value; }
        }

        public virtual StockInOut StockInOut
        {
            get { return _stockInOut; }
            set { _stockInOut = value; }
        }

        public virtual WareHouse WareHouse
        {
            get { return _wareHouse; }
            set { _wareHouse = value; }
        }

        public virtual UserAccount Producer
        {
            get { return _producer; }
            set { _producer = value; }
        }
        #endregion
    }
    #endregion
}